The present invention relates to a method and an apparatus for reducing block distortion occurring in block encoding with which input data, such as still image data or moving image data, is formed into blocks so as to be subjected to a DCT encoding process and to a method and an apparatus for encoding data while the block distortion is reduced.
Hitherto, as an encoding method for efficiently compressing and encoding still image data, moving image data or the like, a block encoding method, such as block DCT (Discrete Cosine Transformation) method, has been known.
When image data or the like is compressed/expanded by the block encoding method, block distortion (block noise) sometimes occurs. In proportion to the compression ratio, distortion easily occurs. Since the DCT encoding process is arranged to perform transformation in a closed space in a block and no consideration is made about correlation across the block boundary, continuity across the block boundary cannot be maintained. Thus, deviation of the value of reproduced data occurring in a boundary region from an adjacent block is perceptible as noise. Since block distortion occurring when image data is block-encoded has a certain type of regularity, the foregoing block distortion is more perceptible as compared with usual random noise. Therefore, the foregoing distortion considerably deteriorate the image quality.
To reduce block distortion, document xe2x80x9cNOISE ELIMINATING FILTER ON THE BASIS OF MC-DCT CODING METHODxe2x80x9d, Ida and Datake, 7-35, theses for lectures in Spring National Meeting of Electronic Information Society, 1990, has disclosed a technique in which edges which are original information of an image is preserved. Moreover, noise of the edges are eliminated by using quantized steps to determine whether the filter is turned on or off. Moreover, the processing direction is changed to perform a plurality of processes. Moreover, document xe2x80x9cCHARACTERISTICS OF ADAPTIVE NOISE ELIMINATING FILTER IN BLOCK-ENCODING OF IMAGExe2x80x9d, Izawa, Vol. 74, pp. 89-100, transactions of Department of Engineering, Shinshu University, has disclosed a technique in which also peripheral blocks are extracted so as to be subjected to DCT process so that noise frequency components are removed.
However, the former method in which the noise eliminating filter is turned on or off has a problem in that high-frequency components of the image are omitted and thus the resolution deteriorates though the process can easily be performed.
The latter method in which the adaptive noise eliminating filter is employed is able to effectively reduce block distortion while the resolution is maintained. However, a complicated process must be performed and thus cost reduction cannot be performed. Therefore, the foregoing method is not a preferred method for consumer appliances.
What is worse, there arises a problem in that the block distortion cannot completely be reduced because of an incorrect determination of the block distortion. Another problem arises in that an edge is erroneously corrected, causing pseudo edge to be formed.
The rate of bit streams encoded by the block encoding method is sometimes converted into different bit-rate bit stream from, for example, 8 Mbps to 4 Mbps in order to be adaptable to, for example, an apparatus set to a different bit rate.
When the rate of bit streams encoded by the block encoding method is converted so as to be again encoded, the encoding process is as it is performed even if block noise occurs in an image decoded by a decoder.
Therefore, when a motion vector is detected such that motion compensation is employed to perform prediction encoding in a case of re-encoding or format conversion, the accuracy to detect the motion vector deteriorates because of disturbance made by block noise.
The position at which block noise occurs depends on the position of the boundary between blocks. Therefore, when re-encoding or encoding for format is performed by using an encoding method in which the positions of the boundaries between blocks are the same such that block noise in an image in which block noise occurs is not eliminated, there arises a problem in that the block noise is furthermore highlighted in the reproduced image.
The method of block-encoding image data is exemplified by MPEG (Moving Picture Experts Group) formed by combining the DCT which uses correlation in an image, the motion compensation using correlation between frames and Huffinan encoding which uses the correlation of code strings.
In view of the foregoing, an object of the present invention is to provide a method and an apparatus for reducing block distortion which requires a simple process and with which omission of high-frequency components can be reduced, reduction or elimination of block distortion can stably be performed, an incorrect determination occurring when block distortion is determined can be reduced, deterioration in an accuracy to detect motion vector which takes place when re-encoding is performed can be reduced and block noise can be reduced and to provide an encoding method and an encoding apparatus which are capable of reducing block noise.
To achieve the above-mentioned objects, according to one aspect of the present invention, there is provided a method of reducing block distortion which occurs when image data is block-encoded, the method comprising the steps of: detecting, from input image data, a parameter indicating a degree of difficulty in encoding; calculating, from input image data, a parameter required to determine block distortion; determining the block distortion in accordance with a result of detection of the parameter indicating the degree of difficulty in encoding and a result of the calculation of the parameter; calculating a correction value for reducing the block distortion; and correcting input image data with a correction value which corresponds to a result of the determination of the block distortion so as to produce an output.
When the parameter obtained from input image data and indicating the degree of difficulty in encoding is used to determine block distortion for the purpose of reducing the block distortion, the determination can effectively be performed and incorrect determination can be reduced.